home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-01
/
tcoop10a.zip
/
DOC.ZIP
/
ICON.DOC
< prev
next >
Wrap
Text File
|
1991-11-20
|
6KB
|
132 lines
ICON.DOC 11/15/91 Copyright (c) 1991 by James S. Clark
==========================================================================
ICON
Icon Class
--------------------------------------------------------------------------
Class Name Icon
Superclass <none>
Category Graphics
Other classes referenced <none>
Other catagories referenced <none>
Used by <none>
Inherited by <none>
Declaration Icon *icon = new Icon(max, wide, high);
Instance Variables
char *icon[256];
int iconmax;
int iconwide;
int iconhigh;
Instance Methods
Icon (int max = 256, int wide = 16,
int high = 16);
~Icon ();
void draw (int num, int x, int y);
void drawmasked(int num, int x, int y,
int mask);
void get (int num, int x, int y);
void getmask (int num, int x, int y,
int color);
void put (int num, int x, int y);
void putmasked (int num, int x, int y,
int mask);
void read (int num, char *filename);
void reads (int num, char *filename);
void scan (int num, int x, int y);
void write (int num, char *filename);
void writes (int num, char *filename);
--------------------------------------------------------------------------
GENERAL DESCRIPTION
The Icon Class is used to manipulate large libraries of small images using
the BGI driver. It allows you to create and draw standard and masked
icons, as well as load and save icons to the disk drive one at a time,
or in large groups. The maximum number of Icons in a group is 256.
NOTE: The BGI graphics driver MUST be initiazed before actually drawing
any icons. The Icon Class does NOT require the use of the Graphic Class,
but does require that you initialize the display screen before using
the put() method.
--------------------------------------------------------------------------
VARIABLES
char *icon[256];
The array of pointers to the icons in the array. Generally you
will not access this directly, but it is provided so that you
can if you need to. The maximum is 256 icons.
int iconmax;
The number of icons held in the current icon array.
int iconwide;
The width in pixels of the current icon array.
int iconhigh;
The height in pixels of the current icon.
--------------------------------------------------------------------------
METHODS
Icon (int max = 256, int wide = 16, int high = 16);
Creates a new instance of the Icon Class and initializes the
icon array. If no parameters are given, the default is 256 icons
16 pixels wide and 16 pixels high.
~Icon ();
Deallocates the memory for the icon array. This is called last
to make sure that things are cleaned-up nicely.
void draw (int num, int x, int y);
Place the numbered icon on the screen at position x, y.
void drawmasked(int num, int x, int y, int mask);
This method will draw an icon and it's matching mask on the
screen at x, y. Both the icon number and the mask number must
be specified.
void get (int num, int x, int y);
Get an icon image from the screen at scaled position x,y and
place it into the icon array at the numbered position.
void getmask (int num, int x, int y, int backcolor);
Creates an icon mask by converting the background color pixels of
the image at the scaled position x,y to white and saving the result
in the numbered position of the icon array. This method reads the
display screen to create the mask. It will draw over any existing
data in the screen, and then read the resulting mask.
void put (int num, int x, int y);
Place the numbered icon on the screen at the scaled position x, y.
void putmasked (int num, int x, int y, int mask);
This method will place an icon and it's matching mask on the
screen at the scaled postion x, y. Both the icon number and the
mask number must be specified.
void read (int num, char *filename);
Reads a number of icons from the disk, starting at the beginning
of the file, and places them into the icon array.
void reads (int num, char *filename);
Reads a single icon from the disk and places it into the icon
array in the numbered position.
void scan (int num, int x, int x);
The method does the same thing as get(), but uses absolute screen
coordinates, not scaled.
void write (int num, char *filename);
Writes a number of icons to the disk, starting at the begging of
the array, and places them in a file.
void writes (int num, char *filename);
Writes a single icon to the disk and places it into the same
relative position as in the icon array.
--------------------------------------------------------------------------
ICON.DOC Copyright (c) 1991 by James S. Clark
==========================================================================